<script setup lang="ts">


import FooterBar from "@/components/index/footer/FooterBar.vue";
import {ref} from "vue";
import {Psychologicalevaluation} from "@/http/Personal center";
import {useCounterStore} from "@/stores/SaveUser";
const data=ref({
    pageNum: 4,
    pageSize: 4
})
const titleid=useCounterStore()
const dates=ref({})
Psychologicalevaluation(data.value).then(res=>{
    dates.value=res.rows
    console.log(dates.value)
    console.log(res.rows)
})
function add(item){
    console.log(item.id)
    titleid.title=item.id
    console.log(titleid.title)
}

const onClickLeft = () => history.back();

</script>

<template>
<div>
    <van-nav-bar
        :fixed=true
        :placeholder=true
        title="心理测评"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />
    <router-link to="/PsychoLogical" id="nmxi">
    <div class="test" v-for="item in dates" :key="item.id" @click="add(item)">
        {{item.name}}
    </div>
    </router-link>
    <footer-bar></footer-bar>
</div>
</template>

<style scoped lang="less">
#dnoenf{
    background-color: #f4f4f4;
    margin-bottom: 20px;
}
#nmxi{
    color: black;
    .test{
        border-radius: 10px;
        border: 1px solid #9e75f5;
        font-size: 17px;
        width: 60%;
        margin: 3vh auto;
        text-align: center;
        height: 5vh;
        line-height: 5vh;
        background-color: #e5d5fc;

    }
}

</style>